package com.hs.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hs.entity.ConsultantTag;
import com.hs.mapper.ConsultantTagMapper;
import com.hs.service.ConsultantTagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ConsultantTagServiceImpl implements ConsultantTagService {
    @Autowired
    private ConsultantTagMapper consultantTagMapper;
    @Override
    public Integer addconsultantTag(ConsultantTag consultantTag) {
        return consultantTagMapper.addconsultantTag(consultantTag);
    }

    @Override
    public Integer deleteconsultantTag(Integer id) {
        return consultantTagMapper.deleteconsultantTag(id);
    }

    @Override
    public Integer updateconsultantTag(ConsultantTag consultantTag) {
        return consultantTagMapper.updateconsultantTag(consultantTag);
    }

    @Override
    public List<ConsultantTag> consultantTagById(Integer id) {
        return consultantTagMapper.consultantTagById(id);
    }

    @Override
    public PageInfo<ConsultantTag> getConsultantTagByPage(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<ConsultantTag> consultantTags = consultantTagMapper.consultantTagList();
        PageInfo<ConsultantTag> pageInfo = new PageInfo<>(consultantTags);
        return pageInfo;
    }
}
